<!--
 * @Description: 
 * @Version: V1.0.0
 * @Author: yangshangru yangshangru@supconit.com
 * @Date: 2024-08-09 13:50:25
 * @LastEditors: yangshangru yangshangru@supconit.com
 * @LastEditTime: 2024-08-09 14:54:38
 * @FilePath: PreviewModal.vue
 * 2024-08-09 13:50:25
-->
<template>
  <NModal
    :show="show"
    @update:show="$emit('update:show', $event)"
  >
    <div class="custom-modal preview-modal">
      <div class="modal-title">
        <span>文件预览</span>
        <img
          src="@/assets/images/meeting_dialog_close.png"
          alt=""
          @click="$emit('update:show', false)"
        />
      </div>
      <div class="modal-container preview-container">
        <div class="container-top">
          <div class="select-container">
            <n-input v-model:value="searchValue" />
            <NButton
              type="primary"
              size="small"
              @click="emit('submit')"
            >
              <n-icon
                size="14"
                :depth="1"
                color="#fff"
                style="margin-right: 10px"
              >
                <Search />
              </n-icon>
              查询
            </NButton>
          </div>
        </div>
        <div class="container-bottom">
          <NScrollbar>
            <div class="file-list">
              <div
                class="file-item"
                v-for="item in fileList"
                :key="item.name"
              >
                <n-image
                  width="307"
                  height="173"
                  :src="item.src"
                  object-fit="cover"
                />
                <span>{{ item.name }}</span>
              </div>
            </div>
          </NScrollbar>
        </div>
      </div>
    </div>
  </NModal>
</template>

<script setup lang="ts">
import { ref, reactive, h } from 'vue'
import { NButton, NModal, NInput, NIcon, NImage, NScrollbar } from 'naive-ui'
import { useViewerStore } from '../../Common/store'
import { Search } from '@vicons/ionicons5'

const props = defineProps({
  show: {
    type: Boolean,
    required: true
  }
})

const emit = defineEmits(['update:show', 'select', 'reset', 'cancel', 'submit'])

const useStore = useViewerStore()
const searchValue = ref('')

const fileList = ref([
  {
    name: '文件1大幅度辅导费固定话费搭嘎合法干哈久啊时间完为2',
    src: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg'
  },
  {
    name: '文件1',
    src: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg'
  },
  {
    name: '文件1',
    src: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg'
  },
  {
    name: '文件1',
    src: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg'
  },
  {
    name: '文件1',
    src: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg'
  },
  {
    name: '文件1',
    src: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg'
  },
  {
    name: '文件1',
    src: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg'
  },
  {
    name: '文件1',
    src: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg'
  },
  {
    name: '文件1大幅度辅导费固定话费搭嘎合法干哈久啊时间完为2',
    src: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg'
  },
  {
    name: '文件1',
    src: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg'
  },
  {
    name: '文件1',
    src: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg'
  },
  {
    name: '文件1',
    src: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg'
  },
  {
    name: '文件1',
    src: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg'
  },
  {
    name: '文件1',
    src: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg'
  },
  {
    name: '文件1',
    src: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg'
  },
  {
    name: '文件1',
    src: 'https://07akioni.oss-cn-beijing.aliyuncs.com/07akioni.jpeg'
  }
])
</script>

<style lang="scss" scoped>
.preview-modal {
  width: 1376px;
  height: 640px;
  .preview-container {
    position: relative;
    width: 100%;
    padding: 24px;
    flex-direction: column;
    justify-content: flex-start;
  }
  .container-top {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    .select-container {
      display: flex;
      align-items: center;
      gap: 36px;
    }
  }
  .container-bottom {
    width: 100%;
    height: 460px;
    margin-top: 24px;
    .file-list {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      grid-gap: 24px;
      width: 100%;
    }
    .file-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      width: 307px;
      span {
        width: 100%;
        margin-top: 12px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        text-align: center;
        color: #1d2129;
        font-variant-numeric: lining-nums tabular-nums;
        font-size: 16px;
        font-weight: 600;
        line-height: 29.745px; /* 185.906% */
      }
    }
  }
}
:deep(.n-form-item-feedback-wrapper) {
  min-height: 20px;
}
:deep(.n-form-item-label__text) {
  color: #4e5969;
  text-align: right;
  font-size: 12px;
  line-height: 22px; /* 183.333% */
}
:deep(.n-form-item-blank) {
  width: 235px;
  height: 32px;
}
</style>
